﻿<%@ Page Title="" Language="C#" MasterPageFile="~/master/m.master" %>

<script runat="server">

</script>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
	<link href="assets/css/plugins/footable/footable.core.css" rel="stylesheet">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="main" runat="Server">
    <div class="wrapper wrapper-content">
        <div class="row">
            <div class="col-sm-3">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <span class="label label-success pull-right">月</span>
                        <h5>收入</h5>
                    </div>
                    <div class="ibox-content">
                        <h1 class="no-margins">40 886,200</h1>
                        <div class="stat-percent font-bold text-success">
                            98% <i class="fa fa-bolt"></i>
                        </div>
                        <small>总收入</small>
                    </div>
                </div>
            </div>
            <div class="col-sm-3">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <span class="label label-info pull-right">全年</span>
                        <h5>订单</h5>
                    </div>
                    <div class="ibox-content">
                        <h1 class="no-margins">275,800</h1>
                        <div class="stat-percent font-bold text-info">
                            20% <i class="fa fa-level-up"></i>
                        </div>
                        <small>新订单</small>
                    </div>
                </div>
            </div>
            <div class="col-sm-3">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <span class="label label-primary pull-right">今天</span>
                        <h5>访客</h5>
                    </div>
                    <div class="ibox-content">
                        <h1 class="no-margins">106,120</h1>
                        <div class="stat-percent font-bold text-navy">
                            44% <i class="fa fa-level-up"></i>
                        </div>
                        <small>新访客</small>
                    </div>
                </div>
            </div>
            <div class="col-sm-3">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <span class="label label-danger pull-right">最近一个月</span>
                        <h5>活跃用户</h5>
                    </div>
                    <div class="ibox-content">
                        <h1 class="no-margins">80,600</h1>
                        <div class="stat-percent font-bold text-danger">
                            38% <i class="fa fa-level-down"></i>
                        </div>
                        <small>12月</small>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>访问日志</h5>
                        <div class="pull-right">
                            <div class="btn-group hide">
                                <button type="button" class="btn btn-xs btn-white active">天</button>
                                <button type="button" class="btn btn-xs btn-white">月</button>
                                <button type="button" class="btn btn-xs btn-white">年</button>
                            </div>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="row">
                            <div class="col-sm-12">
                                <div class="ibox-content">
	                                <table class="footable table table-stripped log-list  table-bordered table-hover" data-page-size="10">
	                                    <thead>
	                                        <tr>
	                                            <th>编号
	                                            </th>
	                                            <th>日志内容</th>
	                                            <th>操作时间</th>
	                                            <th>操作对象</th>
	                                            <th>访问者IP</th>
	                                            <th>操作员</th>
	                                        </tr>
	                                    </thead>
	                                    <tbody id="pageList">
	                                    </tbody>
	                                </table>
								</div>
								<div class="pageControl"></div>
							</div>
						</div>
                    </div>

                </div>
            </div>
        </div>

    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="footer" runat="Server">
	<script src="assets/js/plugins/footable/footable.all.min.js"></script>
	<script src="assets/js/page/pageControl.js"></script>
    <script src="assets/js/laytpl.js"></script>
    <script type="text/html" id="tpl-log-item">
        {{# for(var i = 0, len = d.length; i < len; i++){ }}
        <tr {{# if(i%2 == 0){ }} class="gradeX footable-even"
			{{# }else{ }} class="gradeX footable-odd" {{# } }}>
            <td>{{d[i].ID}}
            </td>
            <td>{{d[i].LogContent}}
            </td>
            <td>{{d[i].CreateTime.replace('T',' ').substring(0,16)}}
            </td>
            <td>{{d[i].Action}}
            </td>
            <td>{{d[i].HostAddress}}
            </td>
            <td>{{d[i].Operator}}
            </td>
        </tr>
        {{# } }}
    </script>
    <script>
        //用于记录当前页数
        var page = 1;
        //用于记录每页多少条记录
        var size = 10;
        //用于记录总页数
        var pageCount = 0;
        //用于记录总记录数
        var recordCount = 0;
        //获取右侧内容列表
        var loadPageList = function (needLayer) {
        	pageControl.init('Common','GetLog',{
				key: "",
                Page: page,
                Size: size,
				needLayer: needLayer
			},function(result){
				page = result.page;
				if (!Y.checkNull(result.data)) {
					if (result.data.Items.length == 0){
						Y.NoData(body, 5);
						return false;
					}
					var pl = document.getElementById('tpl-log-item').innerHTML;
					laytpl(pl).render(result.data.Items, function (html) {
						document.getElementById('pageList').innerHTML = html;
					});
				}
			});
        }
        loadPageList(true);
    </script>
</asp:Content>

